package tests;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

import pnt.message.Request_Bye;
import pnt.message.parser.PNTParser;
import junit.framework.TestCase;

public class testParsingOfByeMessage extends TestCase {

	Request_Bye r1;
	String s1;
	
	protected void setUp() throws Exception {
		super.setUp();
		
		s1 = 
			"BYE * PNT/1.0 \r\n" +
			"Transaction: 2342"+
			"\r\n\r\n\r\n";
			
			InputStream i = new ByteArrayInputStream(s1.getBytes());
			PNTParser p = new PNTParser(i);

			r1 = (Request_Bye)p.getNextMessage();
			assertTrue("Parsing Failed", r1 != null);
	}

	public void testToStringStringString() {
		assertEquals(s1.toLowerCase(),r1.toString(" \r\n", "\r\n\r\n\r\n").toLowerCase());
	}

}
